import re
import uuid


class AnalysisPlatformIdTool:
    def __init__(self):
        pass

    @staticmethod
    def re_get_id(href):
        pattern = r'([A-Za-z0-9]+)\.html'
        # 处理编号
        str_id = href.split("/")[-1]
        match = re.search(pattern, str_id)
        if match:
            news_id = re.search(pattern, href).group(1)
        else:
            news_id = uuid.uuid4()

        return news_id